﻿

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;


public class BLL_tbl_sub_products
{
    public BLL_tbl_sub_products()
    {

    }

    public List<tbl_sub_products> select(int SUB_PRODUCT_ID)
    {
        DAL_tbl_sub_products dal = new DAL_tbl_sub_products();
        return dal.select(SUB_PRODUCT_ID);
    }

    public List<tbl_sub_products> selectAll()
    {
        DAL_tbl_sub_products dal = new DAL_tbl_sub_products();
        return dal.selectAll();
    }

    public DataTable selectAllForGrid()
    {
        DAL_tbl_sub_products dal = new DAL_tbl_sub_products();
        return dal.selectAllForGrid();
    }

    public bool insert(tbl_sub_products tbl)
    {
        DAL_tbl_sub_products dal = new DAL_tbl_sub_products();
        int i = 0;
        i = dal.insert(
            tbl.PRODUCT_ID
, tbl.PURITY_ID
, tbl.PSD_ID
, tbl.SURFACE_AREA_ID
, tbl.MILL_TYPE_ID
, tbl.STOCK_IN_KG
, tbl.IS_OUTSOURCE
, tbl.OUTSOURCE_DETAILS
, tbl.IS_ACTIVE
, tbl.CREATED_BY
, tbl.CREATED_DATE
        );

        return Convert.ToBoolean(i);
    }


    public bool update(tbl_sub_products tbl)
    {
        DAL_tbl_sub_products dal = new DAL_tbl_sub_products();
        int i = 0;
        i = dal.update(
            tbl.SUB_PRODUCT_ID
, tbl.PRODUCT_ID
, tbl.PURITY_ID
, tbl.PSD_ID
, tbl.SURFACE_AREA_ID
, tbl.MILL_TYPE_ID
, tbl.STOCK_IN_KG
, tbl.IS_OUTSOURCE
, tbl.OUTSOURCE_DETAILS
, tbl.IS_ACTIVE
, tbl.MODIFIED_BY
, tbl.MODIFIED_DATE
            );

        return Convert.ToBoolean(i);
    }


    public bool delete(tbl_sub_products tbl)
    {
        DAL_tbl_sub_products dal = new DAL_tbl_sub_products();
        int i = 0;
        i = dal.delete(
                tbl.SUB_PRODUCT_ID
        );

        return Convert.ToBoolean(i);
    }


}

